home *** CD-ROM | disk | FTP | other *** search
- Path: news.compuserve.com!newsmaster
- From: <75151.03563@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: RE:MFC ::OnIdle()
- Date: 29 Jan 1996 07:06:12 GMT
- Organization: CompuServe Incorporated
- Message-ID: <4ehrl4$km5@dub-news-svc-2.compuserve.com>
- NNTP-Posting-Host: hd83-010.compuserve.com
- Content-Type: text/plain
- Content-length: 1056
- X-Newsreader: AIR Mosaic (16-bit) version 3.10.08.25
-
-
- >> I need to do constant background processing in an MFC Visual C++
- >> application...
- >> I overrode the CWinApp function ::OnIdle() to this...
- >> It works fine except when a Modal Dialog is popped up... OnIdle() is never called
- >>
-
- MFC implements the OnIdle() functionality in the Message Loop that it implements
- for its applications. When there are no messages waiting, it calls the OnIdle()
- function. When you have a Modal Dialog popped up, the MFC message loop is
- not being called. Modal Dialogs use a Windows supplied message loop in USER.EXE
- that knows nothing about MFC (or its message loop). That is why your OnIdle()
- function is not being called while a modal dialog is up.
-
- If you need constant, regular backgrond processing, you have a better option
- than using OnIdle().
-
- Set up a timer. You can start a timer and have it send a WM_TIMER message
- to your window at regular intervals. These message will keep coming even when
- you have a modal dialog up.
-
- Hope this helps,
-
- Tom Keane
- 75151.03563@compuserve.com
-
-
-